<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>3d平移</title>
    <style>
        .box{
            width: 500px;
            height: 500px;
            border: 5px solid gray;
            /* 构建3d平台 必须写preserve-3d  默认flat 2d的意思*/
            transform-style: preserve-3d;
            position: relative;
            margin: auto;
            /*表示视角离屏幕的距离*/
            perspective: 900px;
            /* transform: rotateY(50deg); */
        }
        .center{
            position: absolute;
            width: 200px;
            height: 200px;
            background: red;
            left: 50%;
            top: 50%;
            margin-left: -100px;
            margin-top: -100px;
            /* transform: translateZ(100px); */
            transform: translate3d(0, 0, 100px);
        }
    </style>
</head>
<body>
    <div class="box">
        <dov class="center"></dov>
    </div>
</body>
</html>